home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Estrategia / coffeetycoon_Demo.swf / scripts / DefineButton2_100 / BUTTONCONDACTION on(press).as next >
Encoding:
Text File  |  2006-06-13  |  862 b   |  24 lines

  1. on(press){
  2.    var thisname = parseInt(this._name.substr("location_".length));
  3.    var message;
  4.    if(_root.lastscene == "colony_nest")
  5.    {
  6.       message = "" + _root.moveto_str + " " + _root.localename[thisname] + "\n";
  7.       message += "" + _root.willcost_str + " " + _root.locale_cost[thisname] + " " + _root.gems_str + "\n";
  8.       message += "" + _root.willuse_str + " " + parseInt(_root.antstats[_root.gc_pop] / _root.upkeepcost / _root.foodmovecost) + " " + _root.food_str + "\n";
  9.       _root.confirm_action("nest",thisname,message);
  10.    }
  11.    else
  12.    {
  13.       trace(thisname);
  14.       _root.select_locale(thisname);
  15.       if(_root.lastlocale != _root.localetype)
  16.       {
  17.          _root.move_nest(0);
  18.       }
  19.       _root.lastlocale = _root.localetype;
  20.       _root.locale_visited[_root.localetype] = true;
  21.       _root.pause = false;
  22.    }
  23. }
  24.